package com.hp.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.hp.pojo.Users;

public interface UsersMapper {
	/**
	 * 查询所有用户
	 */
	@Select("select * from users")
	List<Users> findUsers();
	
	/**
	 * 条件查询信息
	 */
	List<Users> findUsersLike(Users users);
	
	/**
	 * 增加用户
	 */
	@Insert("insert into users	values(null,#{acc},#{pwd},#{name1},#{birthday}	)")
	void insertUsers(Users users);
	
	/**
	 * 通过id查询
	 */
	@Select("select * from users where id=#{id}")
	Users getUserById(Integer id);
	
	/**
	 * 根据id刪除用户信息
	 */
	@Delete("delete from users where id=#{id}")
	void deleteUsersById(Users users);
	
	/**
	 * 根据id修改用户信息
	 */
	@Update("update users set acc=#{acc},pwd=#{pwd},name1=#{name1},birthday=#{birthday} where id=#{id}")
	void updateUsersById(Users users);
}
